//1.导入封装好的service
import service from "../utils/request";

//1.登录接口
export function user_login(payload = {}) {
    return service.post('/api/user/login', payload)
}
//2.注册接口
export function user_zhuce(payload = {}) {
    return service.post('/api/user/dofinishregister', payload)
}
//3验证注册手机号
export function user_docheckphone(payload = {}) {
    return service.post('/api/user/docheckphone', payload)
}
//4验证注册手机号和验证码
export function user_docheckcode(payload = {}) {
    return service.post('/api/user/docheckcode', payload)
}
//5获取验证码
export function user_dosendmsgcode(payload = {}) {
    return service.post('/api/user/dosendmsgcode', payload)
}
//6.轮播图接口
export function banner_list(payload = {}) {
    return service.get('/api/banner/list', { params: payload })
}
//7.商品分页列表数据
export function pro_list(payload = {}) {
    return service.get('/api/pro/list', { params: payload })
}
//8.商品秒杀
export function miaosha(payload = {}) {
    return service.get('/api/pro/seckilllist', { params: payload })
}
//9.city - 获取城市按照字母排序列表
export function city_list(payload = {}) {
    return service.get('city/sortCity.json', { params: payload })
}
//10.city - 获取城市列表
export function city_list1(payload = {}) {
    return service.get('city/city.json', { params: payload })
}
//11.分类---产品的分类列表一级左侧
export function categorylist(payload = {}) {
    return service.get('/api/pro/categorylist', { params: payload })
}
//12.分类---获取某分类下某品牌的产品列表-二级右侧
export function categorybrandlist(payload = {}) {
    return service.get('/api/pro/categorybrandlist', { params: payload })
}
//13.详情页面id
export function shop_id(proid) {
    return service.get(('/api/pro/detail/' + proid),)
}
//14.详情页面猜你喜欢推荐列表
export function recommendlist(payload = {}) {
    return service.get('/api/pro/recommendlist', { params: payload })
}
//15.搜索列表
export function search(payload = {}) {
    return service.get('/api/pro/search', { params: payload })
}
//16.热门搜索
export function hotword(payload = {}) {
    return service.get('/api/pro/hotword', { params: payload })
}
//17.加入购物车
export function cart_add(payload = {}) {
    return service.post('/api/cart/add', payload)
}
//18.查看购物车
export function cart_list(payload = {}) {
    return service.post('/api/cart/list', payload)
}
//19.更新购物车数量
export function cart_updatenum(payload = {}) {
    return service.post('/api/cart/updatenum', payload)
}
//20.删除购物车单条数据
export function cart_remove(payload = {}) {
    return service.post('/api/cart/remove', payload)
}
//21.删除当前用户的购物车数据
export function cart_removeall(payload = {}) {
    return service.post('/api/cart/removeall', payload)
}
//22.更新所有购物车数据的选中状态
export function cart_selectall(payload = {}) {
    return service.post('/api/cart/selectall', payload)
}
//23.更新当前购物车数据的选中状态
export function cart_selectone(payload = {}) {
    return service.post('/api/cart/selectone', payload)
}
// 24.添加地址
export function address_add(payload = {}) {
    return service.post('/api/address/add', payload)
}
// 25.地址列表
export function address_list(payload = {}) {
    return service.get('/api/address/list', { params: payload })
}
// 26.删除地址
export function address_del(payload = {}) {
    return service.post('/api/address/delete', payload)
}
// 27.更新地址接口
export function address_update(payload = {}) {
    return service.post('/api/address/update', payload)
}
//28 获取确认订单的信息
export function order_confirmOrder(payload = {}) {
    return service.get('/api/order/confirmOrder', { params: payload })
}
// 29.更新地址接口
export function order_updateOrderAddress(payload = {}) {
    return service.post('/api/order/updateOrderAddress', payload)
}
//30 添加订单
export function order_addOrder(payload = {}) {
    return service.post('/api/order/addOrder', payload)
}
//31查询默认地址
export function address_defaultAddress(payload = {}) {
    return service.post('/api/address/defaultAddress', payload)
}
// 32 查看全部订单
export function user_orderlist(payload = {}) {
    return service.get('/api/user/orderlist', { params: payload })
}
//33 User - 修改密码
export function user_updatePassword(payload = {}) {
    return service.get('/api/user/updatePassword', { params: payload })
}
// 34 绑定用户名
export function user_bindusername(payload = {}) {
    return service.get('/api/user/bindusername', { params: payload })
}
//35 支付时删除购物车选中的数据
export function order_deleteCartItem(payload = {}) {
    return service.get('/api/order/deleteCartItem', { params: payload })
}